package com.atguigu.lease.app.controller;

import com.atguigu.lease.app.service.ApartmentInfoService;
import com.atguigu.lease.model.result.Response;
import com.atguigu.lease.model.vo.app.ApartmentDetailVo;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@Tag(name="公寓信息模块")
@RestController
@RequestMapping("/app/apartment")
public class ApartmentInfoController {

    @Autowired
    private ApartmentInfoService apartmentInfoService;

    @Operation(summary = "根据id查询公寓详情")
    @GetMapping("/getDetailById")
    public Response<ApartmentDetailVo> getDetailById(@RequestParam Long id){
        return Response.ok(apartmentInfoService.getDetailById(id));
    }

}
